package com.yanqu.road.server.cmd.tradewar;

import com.yanqu.road.pb.cross.tradewar.CrossTradeWarProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.cmd.CrossUnionCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.tradewar.CrossTradeWarMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_CROSS_TRADE_WAR_FIRST_GET_NOTICE, desc = "游戏服启动时来拉取公告")
public class CrossTradeWarGetNoticeCmd extends CrossUnionCommand {

    private int activityId;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        CrossTradeWarProto.CrossTradeWarFirstGetNoticeReqMsg reqMsg = CrossTradeWarProto.CrossTradeWarFirstGetNoticeReqMsg.parseFrom(packet.getBytes());
        activityId = reqMsg.getActivityId();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        CrossTradeWarMgr.getServerNoticeList(activityId, serverId);
    }

    @Override
    public void sendData() {

    }
}
